# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor:  Hyacinthe Cartiaux <hyacinthe.cartiaux at free.fr>
# Contributor: Bartlomiej Piotrowski <nospam at bpiotrowski dot pl>
# Contributor: Patrick McCarty <pnorcks at gmail dot com>

pkgname=discount
pkgver=3.0.0.a
_pkgver=3.0.0a
pkgrel=1
pkgdesc='A Markdown implementation written in C'
arch=(loong64 x86_64)
url='https://www.pell.portland.or.us/~orc/Code/discount/'
license=('custom:BSD')
source=(https://github.com/Orc/discount/archive/v$_pkgver/$pkgname-$pkgver.tar.gz)
sha256sums=('9a20af1ee09d2369543a421ba65e6fc1fd482ad3a5b1828132441f2c8dd98afc')
depends=(glibc)

build() {
  cd $pkgname-$_pkgver
  ./configure.sh \
    --prefix=/usr \
    --enable-all-features \
    --with-fenced-code \
    --shared
  make
}

package() {
  cd $pkgname-$_pkgver
  # fix ldconfig call
  sed -e 's|/sbin/ldconfig|/sbin/ldconfig -n|' -i librarian.sh

  make DESTDIR="$pkgdir" install.everything
  install -Dm644 COPYRIGHT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
